/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package giuliani_mapelli_marocco.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Embeddable;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

@Embeddable
public class WeatherforecastPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Temporal(TemporalType.DATE)
    private Date date;
   
    @Basic(optional = false)
    @Size(min = 1, max = 140)
    @NotNull
    private String place;

    public WeatherforecastPK() {
    }

    public WeatherforecastPK(Date date, String place) {
        this.date = date;
        this.place = place;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public String getPlace() {
        return place;
    }

    public void setPlace(String place) {
        this.place = place;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (date != null ? date.hashCode() : 0);
        hash += (place != null ? place.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof WeatherforecastPK)) {
            return false;
        }
        WeatherforecastPK other = (WeatherforecastPK) object;
        if ((this.date == null && other.date != null) || (this.date != null && !this.date.equals(other.date))) {
            return false;
        }
        if ((this.place == null && other.place != null) || (this.place != null && !this.place.equals(other.place))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "giuliani_mapelli_marocco.entity.WeatherforecastPK[ date=" + date + ", place=" + place + " ]";
    }
    
}
